<template>
	<view>
		<view class="container">
			<u-subsection :list="list" mode="button" :current="current" bold @change="change()" activeColor="#EF4D3D"></u-subsection>
			<u-gap height="20"></u-gap>
			<view class="container_key" v-if="current == 0">
				<input v-model="shipZone" class="input" placeholder="请输入区域"></input>
				<image src="@/static/iocn16.png" @click="exchange()"></image>
				<input v-model="placeShip" class="input" placeholder="请输入区域"></input>
			</view>
			<view  v-else>				
				<u-search placeholder="输入公司名称搜索" v-model="keywords" :showAction="false"></u-search>
			</view>
			<u-gap height="20"></u-gap>
			<u-button type="error"  @click="seek()">查看</u-button>
		</view>
		<view>
			<Tabbar :current="'0'"></Tabbar>
		</view>
	</view>
</template>

<script>
import {
	GetDedLines,
	RouteSetting
} from '@/public/Api/update.js'
import {
	setValue,
	getValue
} from '@/public/storeage/index.js'
import Tabbar from '@/pages/navigation/navigation.vue';
// import pickerAddress from '@/components/wangding-pickerAddress/wangding-pickerAddress.vue'
export default {
	components: {
		//注册组件
		Tabbar,
		// pickerAddress
	},
	data() {
		return {
			skipCount: 0,
			maxResultCount: 10,
			shipZone: "",
			placeShip: '',
			keywords:"",
			current: 0,
			list: ['按路线', '按公司'],
		};
	},
	onLoad() {

	},
	methods: {
		change(e) {
			this.current = e;
		},
		exchange() {
			var Inavs = this.shipZone
			var Iname = this.placeShip
			this.placeShip = Inavs
			this.shipZone = Iname
		},
		async seek() {

			uni.navigateTo({
						url: '/pages/Findspecialline/seek?keywords=' + this.keywords + '&origAddr=' + this.shipZone + '&destAddr=' + this.placeShip
					})

		},

		// 获取通话记录
		async RouteSetting() {
			var skipCount = this.skipCount
			var maxResultCount = this.maxResultCount
			var id = getValue('id')
			try {
				const {
					data: res
				} = await RouteSetting({
					skipCount,
					maxResultCount,
					id
				})
			} catch (e) { }
		},
	}
}
</script>

<style lang="scss">
page {
	background-color: #f7f7f7;
	padding: 20upx 15upx 0;
}

.container {
	border-radius: 17upx;
	background: #FFFFFF;
	box-shadow: 1.75upx 1.75upx 7.01upx 0px #e5e5e5, 1.75upx 1.75upx 7.01upx 0px #e5e5e5;
	padding: 30upx 50upx;

	.container_key {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.input {
			width: 230upx;
			text-align: center;
			border-bottom: 1upx solid #ccc;
			font-size: 24upx;
		}

		image {
			width: 47upx;
			height: 47upx;
		}
	}

}
</style>
